package com.ficus.road.maintain.dao.smart;

import com.ficus.road.maintain.core.dao.BaseMongoDao;
import com.ficus.road.maintain.core.model.smart.Complain;
import com.ficus.road.maintain.core.model.smart.HighwayRanktable;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.stereotype.Component;

@Component
public class HighwayRanktableDao extends BaseMongoDao<HighwayRanktable, String> {
    @Override
    public void indexOperation() {
        super.getMongoTemplate().indexOps(getCollectionName()).ensureIndex(new Index().on("big_type", Sort.Direction.DESC).background());
        super.getMongoTemplate().indexOps(getCollectionName()).ensureIndex(new Index().on("area", Sort.Direction.DESC).background());
    }
    @Override
    public String getCollectionName() {
        return "highway_ranktable";
    }
}
